/** @file         cmd_demo.c
 *  @brief        命令处理框架 使用范例
 *  @details      The code belongs to jiejie, please keep the author information and source code according to the license.
 *  @date         2020/08/18
 *  @version      v1.0
 *  @copyright    Copyright By jiejie, All Rights Reserved
 *
 ***********************************************************************************
 *  @par 修改日志:
 *  <table>
 *  <tr><th>Date        <th>Version  <th>Author    <th>Description
 *  <tr><td>2019/12/17  <td>1.0      <td>jiejie    <td>创建初始版本
 *  <tr><td>2020/09/23  <td>1.1      <td>jiejie    <td>新增回调函数接口例程
 *  </table>
 *
 **********************************************************************************
 */

#include "cmd.h"
#include <stdio.h>
void test1_cmd(void)
{
    printf("test1_cmd\n");
    //set_cmd_callback_flag(CMD_OK);
}

void test2_cmd(void)
{
    printf("test2_cmd\n");
    set_cmd_callback_flag(CMD_OK);
}

void test3_cmd(void)
{
    printf("test3_cmd\n");
    set_cmd_callback_flag(CMD_OK);
}

int main(void)
{
    cmd_init();
    REGISTER_CMD("test1", test1_cmd, "test1 demo");
    REGISTER_CMD("test2", test2_cmd, "test2 demo");
    REGISTER_CMD("test3", test3_cmd, "test3 demo");

    while (1)
    {
        cmd_parsing("list");
        cmd_parsing("test1");
        cmd_parsing("test2");
        cmd_parsing("test3");
        break;
    }
    cmd_deinit();
    
    return 0;
}
